package com.ict.web.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ict.common.utils.DateUtils;
import com.ict.common.utils.bean.BeanUtils;
import com.ict.web.domain.PerformanceIndicators;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 绩效指标对象 yzq_performance_indicators
 *
 * @author ruoyi
 * @date 2022-02-15
 */
@Data
public class UpdatePerIndicatorsDto {
    @ApiModelProperty(value = "指标id")
    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long indicatorsId;

    @ApiModelProperty(value = "指标名称")
    private String indicatorsName;

    @ApiModelProperty(value = "指标权重{保留两位小数}")
    private BigDecimal indicatorsWeight;

    public static PerformanceIndicators of (UpdatePerIndicatorsDto updateDto){
        PerformanceIndicators bean = new PerformanceIndicators();
        BeanUtils.copyProperties(updateDto,bean);
        //设置更新时间
        bean.setUpdateTime(DateUtils.getNowDate());
        return bean;
    }
}

